//
//  DDDiscoverJobCell.m
//  DingDongZP
//
//  Created by Jyh on 16/3/16.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import "DDDiscoverJobCell.h"

@implementation DDDiscoverJobCell

- (void)awakeFromNib {
    // Initialization code
    self.mainBgView.layer.cornerRadius = 5;
    self.mainBgView.layer.masksToBounds = YES;
    self.avatarImageView.layer.cornerRadius = CGRectGetWidth(self.avatarImageView.frame)/2;
    self.avatarImageView.layer.masksToBounds = YES;
    
    self.jobNameLabel.text = @"";
    self.wageLabel.text = @"";
    [self.wageLabel sizeToFit];
    self.cityLabel.text = @"";
    self.experienceLabel.text = @"";
    self.educationLabel.text = @"";
    self.personInfoLabel.text = @"";
    self.companyNumberLabel.text = @"";
    self.sortIntroductionLabel.text = @"";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)updateViewWithData:(DDJobsDetail *)detail
{
    if (detail) {
        
        
//        [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kImagePre,detail.logo]] placeholderImage:[UIImage imageNamed:@"common_avatar"]];
        [self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:[DDAPIGenerate imageURLWithPath:detail.logo]] placeholderImage:[UIImage imageNamed:@"common_avatar"]];
        
        self.jobNameLabel.text = [NSString stringWithFormat:@"%@",!detail.jobtitle?@"职位":detail.jobtitle];
        self.wageLabel.text = [NSString stringWithFormat:@"￥%@",!detail.salary?@"薪资":detail.salary];
        self.cityLabel.text = [NSString stringWithFormat:@"%@",!detail.city?@"城市":detail.city];
        self.experienceLabel.text = [NSString stringWithFormat:@"%@",!detail.experience?@"经验":detail.experience];
        self.educationLabel.text = [NSString stringWithFormat:@"%@",!detail.edu?@"教育程度":detail.edu];
        self.personInfoLabel.text = [NSString stringWithFormat:@"%@ | %@",!detail.employername?@"姓名":detail.employername,!detail.position?@"职位":detail.position];
        self.companyNumberLabel.text = [NSString stringWithFormat:@"%@",!detail.companysize?@"未填写":detail.companysize];//公司规模
//        self.sortIntroductionLabel.text = [NSString stringWithFormat:@"%@",!detail.jobdesc?@"未填写":detail.jobdesc];
        //!detail.companyshortname?@"公司":detail.companyshortname,
        self.sortIntroductionLabel.text = [NSString stringWithFormat:@"%@",!detail.companyshortname?@"公司":detail.companyshortname];
    }
}

@end
